﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lm.Common.Auth.Operation
{
    class OperationDal
    {
        public Model.Operation GetById(Guid operationId)
        {
            using (var tran = new System.Transactions.TransactionScope())
            {
                var helper = Lm.Common.Auth.DAL.DALFactory.Create();
                if (helper.IsSingle<Model.Operation>(t => t.Id == operationId) == false)
                { throw new Exception("操作不存在，" + operationId); }
                var operation = helper.GetSingle<Model.Operation>(t => t.Id == operationId);
                tran.Complete();
                return operation;
            }
        }
    }
}
